const path = require('path');

function resolve (dir) {
  return path.join(__dirname, dir);
}

module.exports = {
  publicPath: './',  // electron 编译路径
  devServer: {       // 设置开发环境
    // can be overwritten by process.env.HOST
    host: '0.0.0.0',  
    port: 8080
  },
  chainWebpack: config => { // 设置别名
    config.resolve.alias
      .set('@', resolve('src'))
      .set('src', resolve('src'))
      .set('common', resolve('src/common'))
      .set('components', resolve('src/components'));
  },
  pluginOptions:{
    electronBuilder: {
        builderOptions: {
            win: {
                icon: './public/app.ico'  // app 图标
            },
            mac: {
                icon: './public/app.png'  // app 图标
            },
            productName: 'AppDemo'   // app 名称
        }
    }
  }
};